<?php
function blocks_default(){
    //
    $url = getCurrentRequestParameters('url');
    
    $contentMapper = new staticContent_Mapper();
    $obj = $contentMapper->findByUrl($url);
    if(!$obj){
        header("HTTP/1.0 404 Not Found");
        echo "Pagina pe care o cautati nu exista";
        exit;
    }
    $tpl = XTemplate::getInstance();    
    $template = "modules/static_content/static_module.html";
  

    $tpl->assign_file('CONTENT',$template);
    $tpl->assign('moduleTitle', $obj->getTitle());
    $tpl->assign('moduleContent', $obj->getBody());
    $tpl->assign('metaKeywords', $obj->getMetaKeywords() );
    $tpl->assign('metaDescription', $obj->getMetaDescription() );
    $tpl->parse('main.metaKeywords');
    $tpl->parse('main.metaDescription');
    $tpl->parse('main.module_title');

}
?>
